package com.ruoyi.purchase.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.purchase.domain.Classification;
import com.ruoyi.purchase.mapper.ClassificationMapper;
import com.ruoyi.purchase.service.IClassificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * classificationService业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-24
 */
@Service
public class ClassificationServiceImpl implements IClassificationService 
{
    @Autowired
    private ClassificationMapper classificationMapper;

    /**
     * 查询classification
     * 
     * @param id classification主键
     * @return classification
     */
    @Override
    public Classification selectClassificationById(Long id)
    {
        return classificationMapper.selectClassificationById(id);
    }

    /**
     * 查询classification列表
     * 
     * @param classification classification
     * @return classification
     */
    @Override
    public List<Classification> selectClassificationList(Classification classification)
    {
        return classificationMapper.selectClassificationList(classification);
    }

    /**
     * 新增classification
     * 
     * @param classification classification
     * @return 结果
     */
    @Override
    public int insertClassification(Classification classification)
    {
        return classificationMapper.insertClassification(classification);
    }

    /**
     * 修改classification
     * 
     * @param classification classification
     * @return 结果
     */
    @Override
    public int updateClassification(Classification classification)
    {
        classification.setUpdateTime(DateUtils.getNowDate());
        return classificationMapper.updateClassification(classification);
    }

    /**
     * 批量删除classification
     * 
     * @param ids 需要删除的classification主键
     * @return 结果
     */
    @Override
    public int deleteClassificationByIds(Long[] ids)
    {
        return classificationMapper.deleteClassificationByIds(ids);
    }

    /**
     * 删除classification信息
     * 
     * @param id classification主键
     * @return 结果
     */
    @Override
    public int deleteClassificationById(Long id)
    {
        return classificationMapper.deleteClassificationById(id);
    }
}
